package com.glodon.fansi.common;

import java.io.Serializable;

/**
 * @author chenb-c
 *
 */
public class AjaxResult implements Serializable {
	private static final long serialVersionUID = -3815510690435756012L;
	private boolean success = false;
	private String message = "操作失败";

	public static AjaxResult newSuccsess() {
		return new AjaxResult(true, "操作成功");
	}

	public static AjaxResult newSuccsess(String message) {
		return new AjaxResult(true, message);
	}

	public static AjaxResult newError() {
		return new AjaxResult(false, "操作失败");
	}

	public static AjaxResult newError(String message) {
		return new AjaxResult(false, message);
	}

	public AjaxResult(boolean success, String message) {
		super();
		this.success = success;
		this.message = message;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}
